//
//  NSObject+Network.m
//  wozhua
//
//  Created by 王洋 on 16/3/18.
//  Copyright © 2016年 王洋. All rights reserved.
//

#import "NSObject+Network.h"
#import "NSObject+Util.h"

@implementation NSObject (Network)

- (NSMutableDictionary *)getBaseParameters {
    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
    if (!self.requestCancelKey) {
        self.requestCancelKey = [self getSelfMemoryAddress];
    }
    [params setValue:self.requestCancelKey forKey:kSelfMemoryAddressKey];
    return params;
}

- (NSString *)requestCancelKey {
    return objc_getAssociatedObject(self, @selector(requestCancelKey));
}

- (void)setRequestCancelKey:(NSString *)requestCancelKey {
    objc_setAssociatedObject(self, @selector(requestCancelKey), requestCancelKey, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

@end
